using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ibba.agil.core.common;
using ibba.agil.core;

namespace ibba.agil.data.data
{
    public class tbagi031TipoConxCsltKey : IDataKey
    {
        public int codTipoConxCslt { get; set; }
    }

    public class tbagi031TipoConxCslt_COL : CollectionData<tbagi031TipoConxCsltKey, tbagi031TipoConxCslt_ENT>
    {
        private manager.tbagi031TipoConxCslt_COM _manager;
        private Criteria<CriteriaInfo, object> _pesquisa;

        public tbagi031TipoConxCslt_COL()
        {
            _manager = new manager.tbagi031TipoConxCslt_COM();
        }

        public override List<tbagi031TipoConxCslt_ENT> Find(tbagi031TipoConxCsltKey key)
        {
            #region Implementacao do Criterio de Pesquisa

            _pesquisa = new Criteria<CriteriaInfo, object>();
            _pesquisa.Add(new CriteriaInfo()
            {
                EntityData = new tbagi031TipoConxCslt_ENT(),
                LikePattern = LikePattern.Both,
                LogicalType = LogicalOperator.AND,
                NameProperty = "codTipoConxCslt",
                SearchType = LogicalComparator.EQUAL
            }, key.codTipoConxCslt);

            #endregion

            return _manager.Where(CriteriaFind);
        }

        protected override Criteria<CriteriaInfo, object> CriteriaFind()
        {
            return _pesquisa;
        }
    }
}
